/*
 *  JDiv - API for Multimedia Application
 *  http://jdiv.sourceforge.net 
 *  ------------------------------------
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software 
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 *
 */

package com.jdiv.internalClasses;

import com.badlogic.gdx.files.FileHandle;
import com.badlogic.gdx.graphics.Texture.TextureFilter;
import com.badlogic.gdx.scenes.scene2d.ui.Skin;
import com.jdiv.JDiv;

public class JDivSkin extends JDivDisposable {
	
	public FileHandle file;
	Skin   skin;
	
	public JDivSkin( FileHandle file  ){
		
		this.file = file;
		skin      = null;
		
	}
	
	public void load(){
		
		skin = new Skin(file);
		
		if( skin != null ){
		  if( skin.getFont("default-font") != null )
			 skin.getFont("default-font").getRegion().getTexture().setFilter(TextureFilter.Linear, TextureFilter.Linear);
		}else
			JDiv.system.log("ERROR, newSkin() - Can not load skin: " + file.path() );
		
	}
	
	public Skin getSkin(){
		return skin;
	}

	public void dispose() {
		skin.dispose();
		skin = null;
	}

}
